//-------------------------------------------------------------------
//	Copyright (c) 2010-2014  Zhirnov Andrey
//	This file is part of the "UX Standard Lib" project.
//	See copyright notice in "UX_STL_Core.h".
//-------------------------------------------------------------------

#ifdef __UX_STL_UNIT_TEST__

//#define PLATFORM_SDL
#include "../ux_stl_core.h"

using namespace UX_STL;
using namespace UXTypes;
using namespace UXMath;



void Test_CompileTime_TypeTraits ()
{
	// IsPointer //
	STATIC_ASSERTE( TypeTraits::IsPointer< int * >::value );
	STATIC_ASSERTE( TypeTraits::IsPointer< int const * >::value );

	// IsConst //
	STATIC_ASSERTE( TypeTraits::IsConst< const int >::value );
	STATIC_ASSERTE( not TypeTraits::IsConst< int >::value );
	STATIC_ASSERTE( not TypeTraits::IsConst< int * >::value );
	STATIC_ASSERTE( TypeTraits::IsConst< const int * >::value );
	STATIC_ASSERTE( TypeTraits::IsConst< int const * >::value );
	STATIC_ASSERTE( TypeTraits::IsConst< int * const >::value );


	// CopyConst //
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConst< int, float >::type, float >::value );
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConst< const int, float >::type, const float >::value );
	
	STATIC_ASSERTE( not TypeDescriptor::IsSameTypes< TypeTraits::CopyConst< int, float >::type, float * >::value );
	STATIC_ASSERTE( not TypeDescriptor::IsSameTypes< TypeTraits::CopyConst< const int, float >::type, const float * >::value );
	
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConstToPointer< int *, float * >::type, float * >::value );
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConstToPointer< int const *, float * >::type, float const * >::value );

	STATIC_ASSERTE( not TypeDescriptor::IsSameTypes< TypeTraits::CopyConst< int *, float >::type, float * >::value );
	STATIC_ASSERTE( not TypeDescriptor::IsSameTypes< TypeTraits::CopyConst< int const *, float >::type, float const * >::value );
	
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConstToPointer< int, float * >::type, float * >::value );
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConstToPointer< const int, float * >::type, float const * >::value );
	
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConstToReference< int, float & >::type, float & >::value );
	STATIC_ASSERTE( TypeDescriptor::IsSameTypes< TypeTraits::CopyConstToReference< const int, float & >::type, float const & >::value );
}

#endif	// __UX_STL_UNIT_TEST__